package com.gjw.designpattern.bulider;

/**
 * 指挥者
 * 与客户交流
 * 通过客户的请求来指挥建造者建造对应的产品
 */
public class Director {

    private Builder builder = null;

    public Director(Builder builder) {
        this.builder = builder;
    }

    public Computer createComputer(){
        builder.buildCpu();
        builder.buildMainBoard();
        builder.buildRAM();
        Computer computer = builder.createComputer();
        return computer;
    }

}
